package com.asset.salesforce.handlers;

import com.asset.salesforce.R;
import com.asset.salesforce.activities.AboutActivity;
import com.asset.salesforce.activities.SettingsActivity;

import android.app.Activity;
import android.content.Intent;
import android.view.MenuItem;

public class MenuHandler{

	public static void handleOnItemSelected(MenuItem item,Activity activity) {
		switch (item.getItemId()) {
		case R.id.action_logout:{
            System.exit(0);}
		break;
		case R.id.action_exit:{
			activity.finish();
            System.exit(0);}
		break;
		case R.id.action_settings:{
		//	Context context2 = new MenuActivity(context);
			Intent settingsActivity = new Intent(activity.getApplicationContext(), SettingsActivity.class);
			activity.startActivity(settingsActivity);
		}
		break;
		case R.id.action_about:{
			Intent aboutActivity = new Intent(activity.getApplicationContext(), AboutActivity.class);
			activity.startActivity(aboutActivity);
		}
			break;
		
		default:
			break;
		}
 }
}
